
#ifndef  IBREAKPOINTSTATE_H
#define  IBREAKPOINTSTATE_H

#include <ostream>
#include <functional>
class IBreakPointState {
public:
    IBreakPointState(){};
    virtual ~IBreakPointState(){};

    virtual bool isEnd() const = 0;
    virtual bool isInited() const = 0;
    virtual bool isConnected() const = 0;
    virtual bool isLogined() const = 0;
    virtual bool isDisconnected() const = 0;

    typedef std::function<int ()> Callback;

    virtual int toEnd(Callback beforeSwitch) = 0;
    virtual int toInited(Callback beforeSwitch) = 0;
    virtual int toConnected(Callback beforeSwitch) = 0;
    virtual int toLogined(Callback beforeSwitch) = 0;
    virtual int toDisconnected(Callback beforeSwitch) = 0;

    virtual std::ostream &  log(std::ostream & out);

protected:
    static const int END = 0;
    static const int INITED = 1;
    static const int CONNECTED = 2;
    static const int LOGINED = 3;
    static const int DISCONNECTED = 4;
    static const int MAX_STATE = DISCONNECTED + 1;
};


#endif   /* IBREAKPOINTSTATE_H */
